package org.eddycar.jproyeddycar.seguridad.vistas;

import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import org.eddycar.jproyeddycar.seguridad.modelo.TipoUsuario;
import org.eddycar.jproyeddycar.seguridad.modelo.Usuario;
import org.eddycar.jproyeddycar.seguridad.negocio.AdministrarUsuarioUCC;
import org.jdesktop.observablecollections.ObservableList;

public class BuscarUsuario extends javax.swing.JDialog {

    AdministrarUsuarioUCC usuarioUCC = new AdministrarUsuarioUCC();
    Usuario usuario = new Usuario();
    boolean actualizar = false;

    public BuscarUsuario() {
        initComponents();
        setLocationRelativeTo(this);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        buttonGroup1 = new javax.swing.ButtonGroup();
        vistaUsuario = new javax.swing.JDialog();
        panelImage2 = new org.edisoncor.gui.panel.PanelImage();
        panelRound2 = new org.edisoncor.gui.panel.PanelRound();
        txttelCel = new javax.swing.JFormattedTextField();
        lblTelfCel = new javax.swing.JLabel();
        txtTelDom = new javax.swing.JFormattedTextField();
        cbEstadoCivil = new javax.swing.JComboBox();
        txtDirecTrab = new javax.swing.JTextField();
        txtDirec = new javax.swing.JTextField();
        lblDireccion = new javax.swing.JLabel();
        lblDirTrab = new javax.swing.JLabel();
        lblCedulaNuevo = new javax.swing.JLabel();
        lblNombre6 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        lblNombre = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        lblApellido = new javax.swing.JLabel();
        lblTelefonoDom = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        txtNombre = new javax.swing.JTextField();
        txtApellido = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        txtCedulaNuevo = new javax.swing.JFormattedTextField();
        cbxTipoCliente = new javax.swing.JComboBox();
        lblNombre7 = new javax.swing.JLabel();
        btnCancelarCliente = new javax.swing.JButton();
        panelRound3 = new org.edisoncor.gui.panel.PanelRound();
        lblNombre1 = new javax.swing.JLabel();
        txtNomUsuario = new javax.swing.JTextField();
        txtContraseña1 = new org.edisoncor.gui.passwordField.PasswordFieldRound();
        txtContraseña2 = new org.edisoncor.gui.passwordField.PasswordFieldRound();
        lblNombre2 = new javax.swing.JLabel();
        lblNombre3 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        btnGuardarCliente = new javax.swing.JButton();
        lblNombre8 = new javax.swing.JLabel();
        lblNombre9 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        panelImage1 = new org.edisoncor.gui.panel.PanelImage();
        jLabel21 = new javax.swing.JLabel();
        panelRound1 = new org.edisoncor.gui.panel.PanelRound();
        jLabel1 = new javax.swing.JLabel();
        txtCriterio = new javax.swing.JTextField();
        cbxTipo = new javax.swing.JComboBox();
        btnBuscarCliente = new javax.swing.JButton();
        btnLimpiar = new javax.swing.JButton();
        panelRect1 = new org.edisoncor.gui.panel.PanelRect();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblUsuario = new javax.swing.JTable();
        btnEditar = new javax.swing.JButton();
        btnNuevo = new javax.swing.JButton();
        btnCerrarVista = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();

        vistaUsuario.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        vistaUsuario.setTitle("Editar Usuario");
        vistaUsuario.setAlwaysOnTop(true);
        vistaUsuario.setMinimumSize(new java.awt.Dimension(604, 628));
        vistaUsuario.setResizable(false);

        panelImage2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/eddycar/jproyeddycar/negocio/Imagenes/pantalla.jpg"))); // NOI18N

        txttelCel.setDisabledTextColor(new java.awt.Color(0, 0, 0));

        lblTelfCel.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblTelfCel.setForeground(new java.awt.Color(255, 255, 255));
        lblTelfCel.setText("Celular:");

        txtTelDom.setDisabledTextColor(new java.awt.Color(0, 0, 0));

        cbEstadoCivil.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SOLTERO", "CASADO" }));
        cbEstadoCivil.setOpaque(false);
        cbEstadoCivil.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbEstadoCivilActionPerformed(evt);
            }
        });

        txtDirecTrab.setDisabledTextColor(new java.awt.Color(0, 0, 0));

        txtDirec.setDisabledTextColor(new java.awt.Color(0, 0, 0));

        lblDireccion.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblDireccion.setForeground(new java.awt.Color(254, 254, 254));
        lblDireccion.setText("Dirección:");

        lblDirTrab.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblDirTrab.setForeground(new java.awt.Color(254, 254, 254));
        lblDirTrab.setText("Dir. Lugar de Trabajo:");

        lblCedulaNuevo.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblCedulaNuevo.setForeground(new java.awt.Color(255, 255, 255));
        lblCedulaNuevo.setText("Cédula:");

        lblNombre6.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblNombre6.setForeground(new java.awt.Color(255, 255, 255));
        lblNombre6.setText("Nombres:");

        jLabel26.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel26.setForeground(new java.awt.Color(255, 0, 0));
        jLabel26.setText("*");

        lblNombre.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblNombre.setForeground(new java.awt.Color(255, 255, 255));
        lblNombre.setText("Estado Civil:");

        jLabel27.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel27.setForeground(new java.awt.Color(255, 0, 0));
        jLabel27.setText("*");

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel16.setForeground(new java.awt.Color(255, 0, 0));
        jLabel16.setText("*");

        lblApellido.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblApellido.setForeground(new java.awt.Color(255, 255, 255));
        lblApellido.setText("Apellidos:");

        lblTelefonoDom.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblTelefonoDom.setForeground(new java.awt.Color(255, 255, 255));
        lblTelefonoDom.setText("Tel. Domicilio:");

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel10.setForeground(new java.awt.Color(255, 0, 0));
        jLabel10.setText("*");

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel9.setForeground(new java.awt.Color(255, 0, 0));
        jLabel9.setText("*");

        txtApellido.setDisabledTextColor(new java.awt.Color(0, 0, 0));

        jLabel25.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel25.setForeground(new java.awt.Color(255, 0, 0));
        jLabel25.setText("*");

        txtCedulaNuevo.setText("0         ");

        cbxTipoCliente.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SECRETARIO", "GERENTE" }));
        cbxTipoCliente.setOpaque(false);
        cbxTipoCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbxTipoClienteActionPerformed(evt);
            }
        });

        lblNombre7.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblNombre7.setForeground(new java.awt.Color(254, 254, 254));
        lblNombre7.setText("Tipo de Usuario:");

        javax.swing.GroupLayout panelRound2Layout = new javax.swing.GroupLayout(panelRound2);
        panelRound2.setLayout(panelRound2Layout);
        panelRound2Layout.setHorizontalGroup(
            panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound2Layout.createSequentialGroup()
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelRound2Layout.createSequentialGroup()
                        .addGap(118, 118, 118)
                        .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblCedulaNuevo)
                            .addComponent(lblNombre6)
                            .addComponent(lblApellido)
                            .addComponent(lblNombre))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelRound2Layout.createSequentialGroup()
                                .addComponent(txtCedulaNuevo, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(panelRound2Layout.createSequentialGroup()
                                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelRound2Layout.createSequentialGroup()
                                        .addComponent(cbEstadoCivil, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(txtNombre, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
                                    .addComponent(txtApellido, javax.swing.GroupLayout.Alignment.LEADING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(panelRound2Layout.createSequentialGroup()
                        .addGap(56, 56, 56)
                        .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(panelRound2Layout.createSequentialGroup()
                                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(lblDireccion)
                                    .addComponent(lblTelefonoDom)
                                    .addComponent(lblDirTrab))
                                .addGap(2, 2, 2))
                            .addComponent(lblTelfCel)
                            .addComponent(lblNombre7))
                        .addGap(10, 10, 10)
                        .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelRound2Layout.createSequentialGroup()
                                .addComponent(txtDirec, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(2, 2, 2)
                                .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(txtTelDom)
                                .addComponent(txttelCel, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(panelRound2Layout.createSequentialGroup()
                                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(cbxTipoCliente, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtDirecTrab, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(121, Short.MAX_VALUE))
        );
        panelRound2Layout.setVerticalGroup(
            panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblCedulaNuevo)
                    .addComponent(txtCedulaNuevo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblNombre6)
                    .addComponent(jLabel25))
                .addGap(6, 6, 6)
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblApellido)
                    .addComponent(jLabel10))
                .addGap(18, 18, 18)
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbEstadoCivil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(lblNombre))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTelfCel)
                    .addComponent(txttelCel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTelefonoDom)
                    .addComponent(txtTelDom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblDireccion)
                    .addComponent(jLabel26)
                    .addComponent(txtDirec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel27)
                        .addComponent(txtDirecTrab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(lblDirTrab))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelRound2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbxTipoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblNombre7))
                .addGap(28, 28, 28))
        );

        btnCancelarCliente.setText("Cancelar");
        btnCancelarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarClienteActionPerformed(evt);
            }
        });

        lblNombre1.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblNombre1.setForeground(new java.awt.Color(254, 254, 254));
        lblNombre1.setText("Confirmar Contraseña:");

        lblNombre2.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblNombre2.setForeground(new java.awt.Color(254, 254, 254));
        lblNombre2.setText("Nombre de Usuario:");

        lblNombre3.setFont(new java.awt.Font("GentiumAlt", 0, 12));
        lblNombre3.setForeground(new java.awt.Color(254, 254, 254));
        lblNombre3.setText("Contraseña:");

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel17.setForeground(new java.awt.Color(255, 0, 0));
        jLabel17.setText("*");

        jLabel18.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel18.setForeground(new java.awt.Color(255, 0, 0));
        jLabel18.setText("*");

        javax.swing.GroupLayout panelRound3Layout = new javax.swing.GroupLayout(panelRound3);
        panelRound3.setLayout(panelRound3Layout);
        panelRound3Layout.setHorizontalGroup(
            panelRound3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound3Layout.createSequentialGroup()
                .addGap(44, 44, 44)
                .addGroup(panelRound3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblNombre1)
                    .addComponent(lblNombre3)
                    .addComponent(lblNombre2))
                .addGroup(panelRound3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelRound3Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(txtNomUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(3, 3, 3)
                        .addComponent(jLabel18))
                    .addGroup(panelRound3Layout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addComponent(txtContraseña1, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)
                        .addComponent(jLabel17))
                    .addGroup(panelRound3Layout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addComponent(txtContraseña2, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(148, Short.MAX_VALUE))
        );
        panelRound3Layout.setVerticalGroup(
            panelRound3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound3Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(panelRound3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblNombre2)
                    .addComponent(txtNomUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18))
                .addGap(13, 13, 13)
                .addGroup(panelRound3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelRound3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtContraseña1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblNombre3))
                    .addComponent(jLabel17))
                .addGap(5, 5, 5)
                .addGroup(panelRound3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtContraseña2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblNombre1))
                .addContainerGap(26, Short.MAX_VALUE))
        );

        btnGuardarCliente.setText("Guardar");
        btnGuardarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarClienteActionPerformed(evt);
            }
        });

        lblNombre8.setFont(new java.awt.Font("GentiumAlt", 1, 12));
        lblNombre8.setForeground(new java.awt.Color(255, 255, 255));
        lblNombre8.setText("Datos de Usuario");

        lblNombre9.setFont(new java.awt.Font("GentiumAlt", 1, 12));
        lblNombre9.setForeground(new java.awt.Color(255, 255, 255));
        lblNombre9.setText("Datos Personales");

        jLabel13.setFont(new java.awt.Font("Flubber", 1, 11));
        jLabel13.setForeground(new java.awt.Color(255, 255, 255));
        jLabel13.setText("Campos");

        jLabel14.setFont(new java.awt.Font("Flubber", 1, 11));
        jLabel14.setForeground(new java.awt.Color(255, 255, 255));
        jLabel14.setText("obligatorios.");

        jLabel15.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel15.setForeground(new java.awt.Color(255, 0, 0));
        jLabel15.setText("*");

        javax.swing.GroupLayout panelImage2Layout = new javax.swing.GroupLayout(panelImage2);
        panelImage2.setLayout(panelImage2Layout);
        panelImage2Layout.setHorizontalGroup(
            panelImage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelImage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelImage2Layout.createSequentialGroup()
                        .addComponent(lblNombre9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 232, Short.MAX_VALUE)
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel14)
                        .addGap(52, 52, 52))
                    .addGroup(panelImage2Layout.createSequentialGroup()
                        .addGroup(panelImage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelImage2Layout.createSequentialGroup()
                                .addComponent(lblNombre8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 382, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelImage2Layout.createSequentialGroup()
                                .addGap(50, 50, 50)
                                .addComponent(btnCancelarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 177, Short.MAX_VALUE)
                                .addComponent(btnGuardarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(62, 62, 62)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelImage2Layout.createSequentialGroup()
                        .addGroup(panelImage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(panelRound3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(panelRound2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap())))
        );
        panelImage2Layout.setVerticalGroup(
            panelImage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelImage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblNombre9)
                    .addComponent(jLabel14)
                    .addComponent(jLabel13)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelRound2, javax.swing.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(lblNombre8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelRound3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelImage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnGuardarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnCancelarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout vistaUsuarioLayout = new javax.swing.GroupLayout(vistaUsuario.getContentPane());
        vistaUsuario.getContentPane().setLayout(vistaUsuarioLayout);
        vistaUsuarioLayout.setHorizontalGroup(
            vistaUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelImage2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        vistaUsuarioLayout.setVerticalGroup(
            vistaUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelImage2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Búsqueda de Cliente");
        setAlwaysOnTop(true);
        setModal(true);
        setResizable(false);

        panelImage1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/eddycar/jproyeddycar/negocio/Imagenes/pantalla.jpg"))); // NOI18N

        jLabel21.setFont(new java.awt.Font("Gastada", 1, 24));
        jLabel21.setForeground(new java.awt.Color(254, 254, 254));
        jLabel21.setText("Administración del Usuario");

        jLabel1.setFont(new java.awt.Font("GentiumAlt", 1, 12));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Bucar Usuario Por:");

        cbxTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cedula", "TODOS" }));

        btnBuscarCliente.setText("Buscar");
        btnBuscarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarClienteActionPerformed(evt);
            }
        });

        btnLimpiar.setText("Limpiar");
        btnLimpiar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLimpiarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelRound1Layout = new javax.swing.GroupLayout(panelRound1);
        panelRound1.setLayout(panelRound1Layout);
        panelRound1Layout.setHorizontalGroup(
            panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound1Layout.createSequentialGroup()
                .addGap(63, 63, 63)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelRound1Layout.createSequentialGroup()
                        .addComponent(cbxTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 147, Short.MAX_VALUE)
                        .addComponent(btnLimpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnBuscarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(txtCriterio, javax.swing.GroupLayout.DEFAULT_SIZE, 481, Short.MAX_VALUE))
                .addGap(71, 71, 71))
        );
        panelRound1Layout.setVerticalGroup(
            panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtCriterio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbxTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnBuscarCliente)
                    .addComponent(btnLimpiar))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${listUsuarioOb}");
        org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, tblUsuario, "");
        org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${cedula}"));
        columnBinding.setColumnName("Cedula");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nombres}"));
        columnBinding.setColumnName("Nombres");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${apellidos}"));
        columnBinding.setColumnName("Apellidos");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${tipoUsuario}"));
        columnBinding.setColumnName("Tipo Usuario");
        columnBinding.setColumnClass(org.eddycar.jproyeddycar.seguridad.modelo.TipoUsuario.class);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jScrollPane1.setViewportView(tblUsuario);

        btnEditar.setText("Editar");
        btnEditar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditarActionPerformed(evt);
            }
        });

        btnNuevo.setText("Nuevo");
        btnNuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelRect1Layout = new javax.swing.GroupLayout(panelRect1);
        panelRect1.setLayout(panelRect1Layout);
        panelRect1Layout.setHorizontalGroup(
            panelRect1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelRect1Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 547, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelRect1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(btnEditar, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)
                    .addComponent(btnNuevo, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE))
                .addContainerGap())
        );
        panelRect1Layout.setVerticalGroup(
            panelRect1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRect1Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(panelRect1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(panelRect1Layout.createSequentialGroup()
                        .addComponent(btnEditar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnNuevo)))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        btnCerrarVista.setText("Cerrar");
        btnCerrarVista.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCerrarVistaActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
        jLabel2.setForeground(new java.awt.Color(254, 254, 254));
        jLabel2.setText("Criterio de Búsqueda");

        jLabel3.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
        jLabel3.setForeground(new java.awt.Color(254, 254, 254));
        jLabel3.setText("Resultado de Búsqueda");

        javax.swing.GroupLayout panelImage1Layout = new javax.swing.GroupLayout(panelImage1);
        panelImage1.setLayout(panelImage1Layout);
        panelImage1Layout.setHorizontalGroup(
            panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage1Layout.createSequentialGroup()
                .addGroup(panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelImage1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(panelRect1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(panelImage1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(panelRound1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(panelImage1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel3))
                    .addGroup(panelImage1Layout.createSequentialGroup()
                        .addGap(198, 198, 198)
                        .addComponent(jLabel21))
                    .addGroup(panelImage1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel2))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelImage1Layout.createSequentialGroup()
                        .addContainerGap(659, Short.MAX_VALUE)
                        .addComponent(btnCerrarVista, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        panelImage1Layout.setVerticalGroup(
            panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(panelImage1Layout.createSequentialGroup()
                        .addComponent(jLabel21)
                        .addGap(26, 26, 26))
                    .addGroup(panelImage1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addComponent(panelRound1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addGap(7, 7, 7)
                .addComponent(panelRect1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnCerrarVista)
                .addGap(21, 21, 21))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelImage1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelImage1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnBuscarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarClienteActionPerformed
        listUsuarioOb.clear();
        if (cbxTipo.getSelectedIndex() == 0) {
            listUsuarioOb.add(usuarioUCC.getUsuarioDao().buscarId(txtCriterio.getText()));
        } else {
            listUsuarioOb.addAll(usuarioUCC.getUsuarioDao().buscarTodos());
        }
    }//GEN-LAST:event_btnBuscarClienteActionPerformed

    private void btnCerrarVistaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarVistaActionPerformed
        this.dispose();
    }//GEN-LAST:event_btnCerrarVistaActionPerformed

private void btnLimpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLimpiarActionPerformed
    listUsuarioOb.clear();
    txtCriterio.setText("");
    tblUsuario.repaint();
}//GEN-LAST:event_btnLimpiarActionPerformed

private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarActionPerformed
    usuario = usuarioUCC.editarUsuario(tblUsuario.getValueAt(tblUsuario.getSelectedRow(), 0).toString());
    usuarioUCC.setUsuarioRespaldo(usuario);
    listUsuarioOb.clear();
    camposUsuario(true);
    reemplazarCampos();
    actualizar = true;
    vistaUsuario.setLocationRelativeTo(this);
    vistaUsuario.setVisible(true);
    this.setVisible(false);
}//GEN-LAST:event_btnEditarActionPerformed

private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoActionPerformed
    limpiarDatosUsuario();
    vistaUsuario.setLocationRelativeTo(this);
    vistaUsuario.setVisible(true);
    this.setVisible(false);
}//GEN-LAST:event_btnNuevoActionPerformed

private void cbxTipoClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbxTipoClienteActionPerformed
}//GEN-LAST:event_cbxTipoClienteActionPerformed

private void btnCancelarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarClienteActionPerformed
    vistaUsuario.setVisible(false);
    limpiarDatosUsuario();
    txtCriterio.setText("");
    listUsuarioOb.clear();
    tblUsuario.repaint();
}//GEN-LAST:event_btnCancelarClienteActionPerformed

private void btnGuardarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarClienteActionPerformed
    guardarCUsuario();
    boolean guardar = false;
    if (actualizar == true) {
        usuarioUCC.getUsuarioDao().eliminar(usuarioUCC.getUsuarioRespaldo());
    }
    if (txtCedulaNuevo.getText().isEmpty() != true && txtNombre.getText().isEmpty() != true && txtApellido.getText().isEmpty() != true && txtDirec.getText().isEmpty() != true && txtDirecTrab.getText().isEmpty() != true && txtNomUsuario.getText().isEmpty() != true && txtContraseña1.getText().isEmpty() != true) {
        if (usuarioUCC.getUsuario().verificaCedulaRuc(txtCedulaNuevo.getText().toString()) == true) {
            if (txtContraseña1.getText().equals(txtContraseña2.getText())) {
                usuarioUCC.guardar(usuarioUCC.getUsuario());
                guardar = true;
                vistaUsuario.setVisible(false);
                this.setVisible(true);
            } else {
                JOptionPane.showMessageDialog(this, "La contraseña no coincide");
            }
        } else {
            JOptionPane.showMessageDialog(this, "Cédula Incorrecta", "Error de Datos", JOptionPane.ERROR_MESSAGE);
        }
    } else {
        JOptionPane.showMessageDialog(this, "Falta/n campo/s obligatrios", "Error de Datos", JOptionPane.ERROR_MESSAGE);
    }
    if (actualizar == true) {
        if (guardar == false) {
            usuarioUCC.getUsuarioDao().guardar(usuarioUCC.getUsuarioRespaldo());
        }
    }
}//GEN-LAST:event_btnGuardarClienteActionPerformed

private void cbEstadoCivilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbEstadoCivilActionPerformed
}//GEN-LAST:event_cbEstadoCivilActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBuscarCliente;
    private javax.swing.JButton btnCancelarCliente;
    private javax.swing.JButton btnCerrarVista;
    private javax.swing.JButton btnEditar;
    private javax.swing.JButton btnGuardarCliente;
    private javax.swing.JButton btnLimpiar;
    private javax.swing.JButton btnNuevo;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JComboBox cbEstadoCivil;
    private javax.swing.JComboBox cbxTipo;
    private javax.swing.JComboBox cbxTipoCliente;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblApellido;
    private javax.swing.JLabel lblCedulaNuevo;
    private javax.swing.JLabel lblDirTrab;
    private javax.swing.JLabel lblDireccion;
    private javax.swing.JLabel lblNombre;
    private javax.swing.JLabel lblNombre1;
    private javax.swing.JLabel lblNombre2;
    private javax.swing.JLabel lblNombre3;
    private javax.swing.JLabel lblNombre6;
    private javax.swing.JLabel lblNombre7;
    private javax.swing.JLabel lblNombre8;
    private javax.swing.JLabel lblNombre9;
    private javax.swing.JLabel lblTelefonoDom;
    private javax.swing.JLabel lblTelfCel;
    private org.edisoncor.gui.panel.PanelImage panelImage1;
    private org.edisoncor.gui.panel.PanelImage panelImage2;
    private org.edisoncor.gui.panel.PanelRect panelRect1;
    private org.edisoncor.gui.panel.PanelRound panelRound1;
    private org.edisoncor.gui.panel.PanelRound panelRound2;
    private org.edisoncor.gui.panel.PanelRound panelRound3;
    private javax.swing.JTable tblUsuario;
    private javax.swing.JTextField txtApellido;
    private javax.swing.JFormattedTextField txtCedulaNuevo;
    private org.edisoncor.gui.passwordField.PasswordFieldRound txtContraseña1;
    private org.edisoncor.gui.passwordField.PasswordFieldRound txtContraseña2;
    private javax.swing.JTextField txtCriterio;
    private javax.swing.JTextField txtDirec;
    private javax.swing.JTextField txtDirecTrab;
    private javax.swing.JTextField txtNomUsuario;
    private javax.swing.JTextField txtNombre;
    private javax.swing.JFormattedTextField txtTelDom;
    private javax.swing.JFormattedTextField txttelCel;
    private javax.swing.JDialog vistaUsuario;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
    private List<Usuario> listaUsuario = new ArrayList<Usuario>();

    public List<Usuario> getListaUsuario() {
        return listaUsuario;
    }

    public void setListaUsuario(List<Usuario> listaUsuario) {
        this.listaUsuario = listaUsuario;
    }
    ObservableList<Usuario> listUsuarioOb = org.jdesktop.observablecollections.ObservableCollections.observableList(listaUsuario);

    public ObservableList<Usuario> getListUsuarioOb() {
        return listUsuarioOb;
    }

    public void setListUsuarioOb(ObservableList<Usuario> listUsuarioOb) {
        this.listUsuarioOb = listUsuarioOb;
    }

    private void limpiarDatosUsuario() {
        txtCedulaNuevo.setText("");
        txtApellido.setText("");
        txtNombre.setText("");
        txtDirec.setText("");
        txtDirecTrab.setText("");
        txtTelDom.setText("");
        txttelCel.setText("");
        actualizar = false;
        cbEstadoCivil.setSelectedItem("SOLTERO");
    }

    private void camposUsuario(boolean b) {
        txtApellido.setEnabled(b);
        txtNombre.setEditable(b);
        txtDirec.setEnabled(b);
        txtDirecTrab.setEnabled(b);
        txtTelDom.setEnabled(b);
        txttelCel.setEnabled(b);
        cbEstadoCivil.setEnabled(b);
        cbxTipoCliente.setEnabled(b);
    }

    private void reemplazarCampos() {
        Usuario us = usuarioUCC.getUsuario();
        txtApellido.setText(us.getApellidos());
        txtCedulaNuevo.setText(us.getCedula());
        txttelCel.setText(us.getTelefonoCedlular());
        txtDirec.setText(us.getDireccionDomicilio());
        txtDirecTrab.setText(us.getDireccionTrabajo());
        cbEstadoCivil.setSelectedItem(String.valueOf(us.getEstado()));
        txtNombre.setText(us.getNombres());
        txtTelDom.setText(us.getTelefonoDomicilio());
        txtContraseña1.setText(us.getContrasenia());
        txtNomUsuario.setText(us.getNombre());
        txtContraseña2.setText(us.getContrasenia());
    }

    private void guardarCUsuario() {
        usuarioUCC.getUsuario().setCedula(txtCedulaNuevo.getText());
        usuarioUCC.getUsuario().setNombres(txtNombre.getText());
        usuarioUCC.getUsuario().setApellidos(txtApellido.getText());
        usuarioUCC.getUsuario().setTelefonoDomicilio(txtTelDom.getText());
        usuarioUCC.getUsuario().setTelefonoCedlular(txttelCel.getText());
        usuarioUCC.getUsuario().setDireccionDomicilio(txtDirec.getText());
        usuarioUCC.getUsuario().setDireccionTrabajo(txtDirecTrab.getText());
        usuarioUCC.getUsuario().setTipoUsuario(TipoUsuario.valueOf(cbxTipoCliente.getSelectedItem().toString()));
        usuarioUCC.getUsuario().setContrasenia(txtContraseña1.getText());
        usuarioUCC.getUsuario().setNombre(txtNomUsuario.getText());
    }
}
